<?php
  
	 
		 $member = array();


//$openid=$_W['openid'];
		$openid = "YB3UID7585778";
 		$fans = pdo_fetch("SELECT * FROM ".tablename(mc_mapping_fans)." where openid='".$openid."' and uniacid='".$_W['uniacid']."'");  //通过openid和uniacid来查找fans表中的studentid
 		$zhbaseinfo = pdo_fetch("SELECT * FROM ".tablename(zh_base_stu)." where xh='".$fans['studentid']."' and uniacid='".$_W['uniacid']."'");  //通过studentid查找base表中的用户数据信息
 		if(empty($zhbaseinfo)){																													//如果查找不到
			 $memberinfo = pdo_fetch("SELECT * FROM ".tablename(mc_members)." where uid='".$fans['uid']."' and uniacid='".$_W['uniacid']."'");  //通过fans表中的uid来查找用户数据信息
			 $member['xh'] = $memberinfo['studentid'];  
 			$member['xm'] = $memberinfo['realname'];
			 $member['xy'] = $memberinfo['classname'];
			 $member['bj'] = '计科16级1班';
			 
			 $member['gh'] = '';
 		}else{
			 $member['xm'] = $zhbaseinfo['xm']; 
			 $member['xh'] = $zhbaseinfo['xh'];;
			 $member['xy'] = $zhbaseinfo['xy']; 
			 $member['bj'] = $zhbaseinfo['bj'];
			 
 		}
 		




		/*
		$weid = $_W['uniacid'];
		$openid=$_W['openid'];
		$uid = $_W['member']['uid'];
		$_accounts = $accounts = uni_accounts();  
		if(empty($openid)){
			$oauth_account = WeAccount::create($_W['acid']); 
			$callback = urlencode(base64_encode($_SERVER['QUERY_STRING'])); 
			$oauth_account->goYibanAuth($callback);   
			die;
		}
		load()->model('mc');
		if(empty($accounts) || !is_array($accounts) || count($accounts) == 0){

			message('请指定公众号');

		}

		if(!isset($_GPC['acid'])){

			$account = array_shift($_accounts);

			if($account !== false){

				$acid = intval($account['acid']);

			}

		} else {

			$acid = intval($_GPC['acid']);

			if(!empty($acid) && !empty($accounts[$acid])) {

				$account = $accounts[$acid];

			}

		}

		reset($accounts);

		

		$fans = mc_fansinfo($openid,$acid, $weid);
		$member = mc_fetch($fans['uid'], array('realname', 'nickname', 'avatar', 'mobile', 'groupid', 'credit1', 'resideprovince', 'residecity', 'residedist', 'address', 'gender'));

		$mcgroups = mc_groups();

		$member['group'] = $mcgroups[$member['groupid']];

		$setting = $this->module['config'];*/